package com.aoyy.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.aoyy.model.Board;
import com.aoyy.dao.BoardDao;
import com.aoyy.util.Page;
/**============================================================================
 * Board service <code>BoardService</code> 
 * @author this author
 * @date 2017-08-11
 * ============================================================================ */
@Service
public class BoardService {
	@Autowired
	private BoardDao boardDao;
	
	public void setBoardDao(BoardDao boardDao) {
		this.boardDao = boardDao;
	}
	
	public BoardDao getBoardDao() {
		return boardDao; 
	}
	
	public void save(Board board) {
		boardDao.save(board);
	}
	
	public void delete(Board board) {
		boardDao.delete(board);
	}
	
	public void update(Board board) {
		boardDao.update(board);
	}
	
	public List<Board> loadAll() {
		return boardDao.loadAll();
	}
	
	public Board queryBoardByBoardId(Integer boardId) {
		return boardDao.queryBoardByBoardId(boardId);
	}
	
	public Board queryBoardByBoardName(String boardName) {
		return boardDao.queryBoardByBoardName(boardName);
	}
	
	public Board queryOtherWithSameName(Board board) {
		return boardDao.queryOtherBoardWithSameName(board);
	}
	
	// @see com.aoyy.dao.BoardDao
	public Page pagedQuery(Integer pageNo, Integer pageSize) {
		return boardDao.pagedQuery(pageNo, pageSize);
	}
	
}
